<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>拆分和合并</title>
  <link href="../Styles/styles.css" rel="stylesheet" type="text/css"/>
</head>

<body>
  <h2 id="splitting_and_merging">拆分和合并</h2>

  <p class="h2subheading">— 处理章节和文件 —</p>

  <p>An EPUB can consist of one large HTML file with all of your text, or multiple files each containing part of your book. In most EPUBs each main Chapter is stored in its own HTML file in the EPUB. This isn’t required, but it makes it easier to work with the book and can make reading and editing quicker since the files are smaller. All of your files can be accessed using the <a href="../Text/book_browser.html">Book Browser</a>.</p>
  <p>EPUB 可以由一个包含所有文本的大型 HTML 文件组成，也可以由多个文件组成，每个文件包含您的书本的一部分。在大多数EPUB中，每个主要章节都存储在 EPUB 中自己的 HTML 文件中。这不是必需的，但由于文件较小，因此可以更轻松地操作书籍，并可以使阅读和编辑更快。可以使用 <a href="../Text/book_browser.html">图书浏览器</a> 访问您的所有文件。</p>

  <p>If you have loaded an HTML file into Sigil and want to divide it into separate files, then you can use Sigil’s Split functions. And if you have several smaller files that you want to combine into a larger file, then you can use the Merge function.</p>
  <p>如果您已将 HTML 文件加载到 Sigil 中，并希望将其分成单独的文件，则可以使用 Sigil 的“拆分”功能。而且，如果您有几个较小的文件要合并成一个较大的文件，则可以使用“合并”功能。</p>

  <div class="tip">
    <p class="tiptext">Most ereaders start each new HTML file on a new page – giving you automatic page breaks between chapters if you split your Chapters into separate files.</p>
    <p class="tiptext">大多数电子阅读器都会在新页面上启动每个新的 HTML 文件——如果将章节拆分为单独的文件，则会在章节之间自动为您提供分页符。</p>
  </div>

  <h3 class="sigil_not_in_toc">分割一个文件</h3>

  <p>You can split a file into 2 files at your cursor position immediately by clicking the Split At Cursor button <img alt="" src="../Images/split-section_22px.png"/> or selecting the menu item <span class="menuitem">Edit→Split At Cursor</span>.</p>
  <p>通过单击“在光标处拆分”按钮 <img alt="" src="../Images/split-section_22px.png"/> 或选择菜单项 <span class="menuitem">编辑→在光标处分割</span> 可以立即将文件拆分为2个文件。</p>

  <p>This is the easiest way to split a single file. Simply click in your document exactly where you want the file to be split, e.g. at the beginning of a chapter name:</p>
  <p>这是分割单个文件的最简单方法。只需在文档中精确地单击要分割文件的位置即可，例如 章节名称开头：</p>

  <div class="image">
    <img alt="split-start" src="../Images/split-start.png"/>
  </div>

  <p>Then click <img alt="" src="../Images/split-section_22px.png"/> to split the file:</p>
  <p>然后单击 <img alt="" src="../Images/split-section_22px.png"/> 拆分文件：</p>

  <div class="image">
    <img alt="split-after2" src="../Images/split-after1.png"/>
  </div>

  <div class="image">
    <img alt="split-after" src="../Images/split-after2.png"/>
  </div>

  <p>Everything from the beginning of the original file up to the point where you clicked is kept in the first file, and everything after the point you clicked on is put into a new file. Note that the first file kept its name, and a new file with a new name was created to hold the second file. You can rename and edit the files as necessary.</p>
  <p>从原始文件的开头到您单击的点之间的所有内容都保存在第一个文件中，并将您单击之后的所有内容都放入一个新文件中。请注意，第一个文件保留其名称，并创建了一个具有新名称的新文件来保存第二个文件。您可以根据需要重命名和编辑文件。</p>

  <h3 class="sigil_not_in_toc">分割多个文件</h3>

  <p>If you want to split several files or a large file into many files, then you can use the file marking approach.</p>
  <p>如果要将几个文件或一个大文件拆分为多个文件，则可以使用文件标记方法。</p>

  <p>1. Scroll through your file, and wherever you want a new chapter to start click in the document to set your cursor position. Then select the menu item <span class="menuitem">Insert→Split Marker</span> or its shortcut. This will insert code into your document telling Sigil to remember that you want a new chapter to begin here – you will see a horizontal line in Preview exactly where you inserted the marker:</p>
  <p>1.滚动浏览文件，然后在要开始新章节的位置单击鼠标，以设置光标位置。然后选择菜单项 <span class="menuitem">插入→拆分标记</span> 或其快捷方式。这会将代码插入您的文档中，告诉 Sigil 记住您希望从这里开始新的一章——您将在预览中看到一条水平线，确切地说是您插入标记的位置：</p>

  <div class="image">
    <img alt="" src="../Images/split-marker.png"/>
  </div>

  <p>2. When you have marked all your chapters, use <span class="menuitem">Edit→Split At Markers</span>. This will automatically split all of your files into as many files as you marked. If you decide not to split the file, you can delete the horizontal marker lines.</p>
  <p>2.标记完所有章节后，使用 <span class="menuitem">编辑→在标记处分割</span>。这将自动将您的所有文件拆分为您标记的文件数量。如果决定不分割文件，则可以删除水平标记线。</p>

  <p>Once you have split your files you can rename them. And you can even Merge some or all of them together again.</p>
  <p>分割文件后，可以重命名它们。您甚至可以再次合并其中的一部分或全部。</p>

  <div class="tip">
    <p class="tiptext">You can use Find and Replace to insert split markers just before every chapter heading if you have a lot of chapters.</p>
    <p class="tiptext">如果章节很多，可以使用“查找并替换”在每个章节标题之前插入拆分标记。</p>

    <p class="tiptext">If you split a file, any header information is copied to the new file.</p>
    <p class="tiptext">如果拆分文件，则所有标头信息都会复制到新文件中。</p>
  </div>

  <h3 class="sigil_not_in_toc">合并文件</h3>

  <p>If you want to combine two or more files into one file, you can use Merge.</p>
  <p>如果要将两个或多个文件合并为一个文件，可以使用合并。</p>

  <p>To Merge two adjacent files, right-click on the second file and then select the menu item <span class="menuitem">Merge</span>, or select the second file and use the Merge shortcut. The second file will be merged into the first file (the file above). You will not be prompted to confirm the merge.</p>
  <p>要合并两个相邻文件，请右键单击第二个文件，然后选择菜单项 <span class="menuitem">合并</span>，或选择第二个文件并使用“合并”快捷方式。第二个文件将合并到第一个文件（上面的文件）中。系统不会提示您确认合并。</p>

  <p>To Merge more than two files, select all the files you want to merge, then right-click on the selection and choose <span class="menuitem">Merge</span>. You will be prompted to confirm the merge:</p>
  <p>要合并两个以上的文件，请选择要合并的所有文件，然后右键单击所选内容，然后选择 <span class="menuitem">合并</span>。系统将提示您确认合并：</p>

  <div class="image">
    <img alt="split-merge-warning" src="../Images/split-merge-warning.png"/>
  </div>

  <p>Once you confirm OK, your files will be combined into the first file.</p>
  <p>确认确定后，您的文件将被合并到第一个文件中。</p>

  <div class="tip">
    <p class="tiptext">Save your EPUB before Splitting or Merging!</p>
    <p class="tiptext">拆分或合并前请保存您的 EPUB！</p>
  </div>
</body>
</html>